<?php echo CHtml::errorSummary($model); ?>

<div id="courier" class="ui-widget ui-widget-content ui-corner-all">
    <div class="ui-widget-header ui-corner-all">Courier Service import permit</div>
<?php echo CHtml::dropDownList('courier', 1 ,array('UPS'=>'UPS','Fedex'=>'Fedex','DHL'=>'DHL','EMS'=>'EMS','TNT'=>'TNT','Others'=>'Others')); ?>
<?php echo CHtml::textField('awb'); ?>
<?php echo CHtml::link('Add New', '#',array('onClick'=>"addItem($('select#courier').val()+' : '+$('input#awb').val())")); ?>
    <?php $this->widget('application.widgets.container.container');?>
</div>
<br />
<fieldset class="ui-widget">
    <legend class="ui-widget-header ui-corner-all">Import shipment details</legend>
    <div class="simple">
        <label>Job No.</label><?php $this->widget('CAutoComplete',
          array(
                         //name of the html field that will be generated
             'model'=>$model,
             'attribute'=>'jobno',
                         //replace controller/action with real ids
             'url'=>array('enquiry/jobno'),
             'max'=>10, //specifies the max number of items to display

                         //specifies the number of chars that must be entered
                         //before autocomplete initiates a lookup
             'minChars'=>3,
             'delay'=>200, //number of milliseconds before lookup occurs
             'matchCase'=>false, //match case when performing a lookup?

                         //any additional html attributes that go inside of
                         //the input field can be defined here
             'htmlOptions'=>array('size'=>'30'),
             'methodChain'=>'.result(function(event,item){ if(item[1]>0){ $.ajax("import/show.html",{id:item[1]},function(data){$("div.#shippinginfo").append(data)}) } else { import_dialog_form_open(); }})',

             )); ?>
    </div>
</fieldset>
<br>
<div id="shippinginfo"></div>
